/*
Copyright 2007 Julian Asamer

This file is part of Fractalicious.

    Fractalicious is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Fractalicious is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Fractalicious.  If not, see <http://www.gnu.org/licenses/>.
*/

//TODO - this file is simply lacking everything.
//But it will store the fractalspecific settings and allow to edit them.
//Those are eg.: dynamic stroke, dynamic color, front color, background color, draw only last recursion, angles, proportions, etc.
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIView.h>
#import <UIKit/CDStructures.h>
#import <UIKit/UIPushButton.h>
#import <UIKit/UIThreePartButton.h>
#import <UIKit/UINavigationBar.h>
#import <UIKit/UIWindow.h>
#import <UIKit/UIView-Hierarchy.h>
#import <UIKit/UIHardware.h>
#import <UIKit/UITable.h>
#import <UIKit/UITableCell.h>
#import <UIKit/UITableColumn.h>
#import "FRecalcTypes.h"
#import <UIKit/UIImageAndTextTableCell.h>
#import "ColorChooser.h"

enum RecalcType;


@interface FOptions : UIView
{
	NSMutableArray *items;
	UITable *options;
	id delegate;
	UIView *selected;
}

	-(id)init;
	- (void) navigationBar:(UINavigationBar*)navbar buttonClicked:(int)button;
	- (void) reloadData;
	- (void) show;

	- (void)backToNormal;
	
	- (void) setDelegate:(id) del;
	- (id) delegate;
	- (void) valueChanged: (RecalcType) type;
	- (id)addSliderWithMin: (float)min max: (float)max value: (float) init title: (NSString *) string type: (RecalcType) d;
	- (id)addCheckboxWithTitle: (NSString *)title selected: (BOOL) s type: (RecalcType) d;
	- (id)addColorWithColor: (FRGBColor)color title: (NSString *)title type: (RecalcType) d;
	//Datasource:
/*	- (int)numberOfGroupsInPreferencesTable:(UIPreferencesTable *)table;
	- (int)preferencesTable:(UIPreferencesTable *)table numberOfRowsInGroup:(int)group;
	- (UIPreferencesTableCell *)preferencesTable:(UIPreferencesTable *)table cellForGroup:(int)group;
	- (UIPreferencesTableCell *)preferencesTable:(UIPreferencesTable *)table cellForRow:(int)row inGroup:(int)group;
	- (float)preferencesTable:(UIPreferencesTable *)aTable heightForRow:(int)row inGroup:(int)group withProposedHeight:(float)proposed;
	*/
@end

@class UISliderControl;

@interface FOptionsItem : UIImageAndTextTableCell 
{
	RecalcType recalcType;
	id delegate;
}
-(id)initWithRecalcType: (RecalcType) type;
-(BOOL)forceHidingNav;

- (void)setDelegate:(id)d;
- (id)delegate;
@end

@interface FOptionsSlider : FOptionsItem 
{
	UISliderControl * sl;
	float val;
	UIView *view;
}

- (id)initWithTitle: (NSString *) t rangeFrom: (float) min to: (float) max value: (float) init recalcType: (RecalcType) type;
- (UIView *)view;
- (void)view:(id) view handleTapWithCount:(int) count event: (id) event fingerCount:(int) fingers;
- (float) controlValue;
@end


@class UISwitchControl;
@interface FOptionsCheckbox : FOptionsItem 
{
	UISwitchControl * cb;
	UISwitchControl * cb2;
	BOOL val;
	UIView *view;
}
-(id)initWithTitle: (NSString *) t checked: (BOOL) sel recalcType: (RecalcType) type;
- (UIView *)view;
- (BOOL) controlValue;
@end

@interface FOptionsColor : FOptionsItem 
{
	ColorChooser *cc;
}
- (id)initWithTitle: (NSString *) t color: (FRGBColor)c recalcType: (RecalcType) type;
- (UIView *)view;
- (FRGBColor) controlValue;
- (void)colorChosen:(FRGBColor) color tapedOk: (BOOL) ok;
- (BOOL) forceHidingNav;
@end

/*@interface Slidersub : UISliderControl 


@end*/